---------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\sbstjp\OneDrive - Cardiff University\FinalHarvard\Appendix2.5.log
  log type:  text
 opened on:  12 May 2025, 17:06:32

. use "C:\Users\sbstjp\OneDrive - Cardiff University\Nationscapedataset.dta" // Tausanovitch, Chris and Lynn Va
> vreck. 2020. Democracy Fund + UCLA Nationscape, October 10-17, 2019 (version 20200814). Retrieved from [URL].
>   Date accessed: March 09, 2025.

. 
. keep gender age education household_income race_ethnicity weight ideo5 statements_gender_identity reparations
>  group_favorability_blm group_favorability_undocumented start_date

. 
. // Social justice scale
. *Drop missing values
. replace statements_gender_identity=. if statements_gender_identity>4 
(326,285 real changes made, 326,285 to missing)

. replace group_favorability_blm=. if group_favorability_blm>4 
(11,501 real changes made, 11,501 to missing)

. replace reparations=. if reparations>2 
(347,248 real changes made, 347,248 to missing)

. replace group_favorability_undocumented=. if group_favorability_undocumented==999 
(62,889 real changes made, 62,889 to missing)

. 
. *Rename so shorter
. rename group_favorability_blm blm

. rename group_favorability_undocumented undocumented

. rename statements_gender_identity genderidentity

. 
. *Reverse variables so social justice is coded high
. foreach var in blm reparations undocumented {
  2.     qui sum `var'
  3.     local max_value = r(max)
  4.     gen r`var' = `max_value' + 1 - `var'
  5. }
(320,012 missing values generated)
(348,346 missing values generated)
(68,420 missing values generated)

. 
. *Standardize items in the scale from 1-2 - this avoids 0, for reasons outlined in next step
. foreach var in rblm rreparations rundocumented genderidentity {
  2.     summarize `var'
  3.     gen s`var' = 1 + (`var' - r(min)) / (r(max) - r(min))
  4. }

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
        rblm |    145,285    2.661686    1.193011          1          4
(320,012 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
rreparations |    116,951    1.324828    .4683127          1          2
(348,346 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
rundocumen~d |    396,877    2.380649     1.06049          1          4
(68,420 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
genderiden~y |     82,422    2.059632    1.196992          1          4
(382,875 missing values generated)

. 
. *At this point, the scale has a Cronbach's Alpha of 0.78
. 
. * Replace missing values with 0 for the specified variables - this is necessary as Stata doesn't add up missi
> ng values
. foreach var in srblm srreparations srundocumented sgenderidentity {
  2.     replace `var' = 0 if missing(`var')
  3. }
(320,012 real changes made)
(348,346 real changes made)
(68,420 real changes made)
(382,875 real changes made)

. 
. * Initialize the total score and the count of non-zero responses
. gen total_scoreSJV = 0

. gen count_nonzeroSJV = 0

. 
. * Add each variable to the total scale score and count it if non-zero
. foreach var in srblm srreparations srundocumented sgenderidentity {
  2.     replace total_scoreSJV = total_scoreSJV + `var'
  3.     replace count_nonzeroSJV = count_nonzeroSJV + (`var' != 0)
  4. }
(145,285 real changes made)
(145,285 real changes made)
(116,951 real changes made)
(116,951 real changes made)
(396,877 real changes made)
(396,877 real changes made)
(82,422 real changes made)
(82,422 real changes made)

. 
. * Calculate the average score, avoiding division by zero
. gen SocJusValues = .
(465,297 missing values generated)

. replace SocJusValues = total_scoreSJV / count_nonzeroSJV if count_nonzeroSJV > 0
(426,831 real changes made)

. 
. // Demographic variables
. 
. *Drop missing values
. replace ideo5=. if ideo5==999
(49,747 real changes made, 49,747 to missing)

. 
. *Reverse code gender 
. egen maxval = max(gender)

. gen FemaleGender = maxval + 1 - gender

. drop maxval

. 
. *Create dummies
. gen Graduate=.
(465,297 missing values generated)

. replace Graduate=0 if inrange(education, 1, 7)
(303,825 real changes made)

. replace Graduate=1 if inrange(education, 8, 11)
(161,472 real changes made)

. 
. gen BIPOC=. 
(465,297 missing values generated)

. replace BIPOC=0 if race_ethnicity==1
(347,361 real changes made)

. replace BIPOC=1 if inrange(race_ethnicity, 2, 15)
(117,936 real changes made)

. 
. // Standardize
. egen Income = std(household_income)
(24,316 missing values generated)

. egen Age = std(age)

. 
. // Regressions
. 
. regress SocJusValues Age BIPOC FemaleGender Graduate Income if quarter(dofc(start_date)) == 4 & year(dofc(sta
> rt_date)) == 2020 [pweight=weight], robust 
(sum of wgt is 71,702.9680235705)

Linear regression                               Number of obs     =     71,673
                                                F(5, 71667)       =     568.95
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0971
                                                Root MSE          =     .31322

------------------------------------------------------------------------------
             |               Robust
SocJusValues | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         Age |  -.0640976   .0019119   -33.53   0.000    -.0678449   -.0603504
       BIPOC |    .133333   .0046526    28.66   0.000     .1242139    .1424521
FemaleGender |   .0671288   .0038275    17.54   0.000     .0596269    .0746307
    Graduate |   .0729436   .0044353    16.45   0.000     .0642504    .0816367
      Income |   -.004873   .0021121    -2.31   0.021    -.0090127   -.0007333
       _cons |   1.349953   .0064643   208.83   0.000     1.337282    1.362623
------------------------------------------------------------------------------

. eststo
(est1 stored)

. regress SocJusValues Age BIPOC FemaleGender Graduate Income if quarter(dofc(start_date)) == 4 & year(dofc(sta
> rt_date)) == 2020  & ideo5<3 [pweight=weight], robust
(sum of wgt is 19,291.6408742282)

Linear regression                               Number of obs     =     20,085
                                                F(5, 20079)       =      37.56
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0264
                                                Root MSE          =     .26942

------------------------------------------------------------------------------
             |               Robust
SocJusValues | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         Age |  -.0186242   .0029823    -6.24   0.000    -.0244698   -.0127786
       BIPOC |    .020571   .0074105     2.78   0.006     .0060458    .0350963
FemaleGender |   .0670016   .0065559    10.22   0.000     .0541515    .0798517
    Graduate |    .011522   .0071911     1.60   0.109    -.0025733    .0256172
      Income |   .0173463   .0036029     4.81   0.000     .0102844    .0244082
       _cons |   1.568742   .0119423   131.36   0.000     1.545334     1.59215
------------------------------------------------------------------------------

. eststo
(est2 stored)

. regress SocJusValues Age BIPOC FemaleGender Graduate Income if quarter(dofc(start_date)) == 3 & year(dofc(sta
> rt_date)) == 2019 [pweight=weight], robust // 2019 Q3 (Jul-Sep 2019)
(sum of wgt is 57,171.2900977008)

Linear regression                               Number of obs     =     57,818
                                                F(5, 57812)       =     374.11
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0908
                                                Root MSE          =     .33567

------------------------------------------------------------------------------
             |               Robust
SocJusValues | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         Age |  -.0587249   .0024508   -23.96   0.000    -.0635285   -.0539213
       BIPOC |   .1615785   .0061773    26.16   0.000     .1494709    .1736861
FemaleGender |   .0514215   .0049472    10.39   0.000      .041725     .061118
    Graduate |   .0679716   .0058083    11.70   0.000     .0565872    .0793559
      Income |   -.019834    .002794    -7.10   0.000    -.0253103   -.0143576
       _cons |   1.295329    .008042   161.07   0.000     1.279566    1.311091
------------------------------------------------------------------------------

. eststo
(est3 stored)

. regress SocJusValues Age BIPOC FemaleGender Graduate Income if quarter(dofc(start_date)) == 4 & year(dofc(sta
> rt_date)) == 2019 [pweight=weight], robust // 2019 Q4 (Oct-Dec 2019)
(sum of wgt is 70,291.9402473491)

Linear regression                               Number of obs     =     70,317
                                                F(5, 70311)       =     341.01
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0676
                                                Root MSE          =     .33192

------------------------------------------------------------------------------
             |               Robust
SocJusValues | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         Age |   -.054081   .0021519   -25.13   0.000    -.0582987   -.0498632
       BIPOC |   .1218844   .0054378    22.41   0.000     .1112264    .1325425
FemaleGender |   .0495486   .0043306    11.44   0.000     .0410606    .0580365
    Graduate |   .0753855   .0050472    14.94   0.000      .065493    .0852779
      Income |  -.0131125   .0024241    -5.41   0.000    -.0178637   -.0083614
       _cons |   1.296278   .0070837   182.99   0.000     1.282394    1.310162
------------------------------------------------------------------------------

. eststo
(est4 stored)

. regress SocJusValues Age BIPOC FemaleGender Graduate Income if quarter(dofc(start_date)) == 1 & year(dofc(sta
> rt_date)) == 2020 [pweight=weight], robust // 2020 Q1 (Jan-Mar 2020)
(sum of wgt is 67,208.0345972013)

Linear regression                               Number of obs     =     67,914
                                                F(5, 67908)       =     395.31
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0726
                                                Root MSE          =     .33017

------------------------------------------------------------------------------
             |               Robust
SocJusValues | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         Age |  -.0580175   .0020821   -27.87   0.000    -.0620983   -.0539366
       BIPOC |    .126763   .0051795    24.47   0.000     .1166111    .1369149
FemaleGender |   .0494092   .0041702    11.85   0.000     .0412356    .0575829
    Graduate |   .0668118   .0047901    13.95   0.000     .0574232    .0762004
      Income |  -.0069912   .0023091    -3.03   0.002     -.011517   -.0024653
       _cons |   1.301122   .0067977   191.41   0.000     1.287798    1.314445
------------------------------------------------------------------------------

. eststo
(est5 stored)

. regress SocJusValues Age BIPOC FemaleGender Graduate Income if quarter(dofc(start_date)) == 2 & year(dofc(sta
> rt_date)) == 2020 [pweight=weight], robust // 2020 Q2 (Apr-Jun 2020)
(sum of wgt is 65,373.256929496)

Linear regression                               Number of obs     =     65,263
                                                F(5, 65257)       =     458.19
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0723
                                                Root MSE          =     .33182

------------------------------------------------------------------------------
             |               Robust
SocJusValues | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         Age |  -.0595454   .0019559   -30.44   0.000     -.063379   -.0557117
       BIPOC |   .1186769   .0050118    23.68   0.000     .1088537    .1285001
FemaleGender |   .0574035   .0039787    14.43   0.000     .0496053    .0652017
    Graduate |   .0644809   .0044171    14.60   0.000     .0558233    .0731385
      Income |   -.005129   .0022009    -2.33   0.020    -.0094428   -.0008152
       _cons |   1.310945   .0066223   197.96   0.000     1.297965    1.323924
------------------------------------------------------------------------------

. eststo
(est6 stored)

. regress SocJusValues Age BIPOC FemaleGender Graduate Income if quarter(dofc(start_date)) == 3 & year(dofc(sta
> rt_date)) == 2020 [pweight=weight], robust // 2020 Q3 (Jul-Sep 2020)
(sum of wgt is 68,910.887677588)

Linear regression                               Number of obs     =     68,986
                                                F(5, 68980)       =     544.59
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0901
                                                Root MSE          =     .31771

------------------------------------------------------------------------------
             |               Robust
SocJusValues | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         Age |   -.062736   .0019607   -32.00   0.000     -.066579    -.058893
       BIPOC |   .1376273   .0047934    28.71   0.000     .1282322    .1470224
FemaleGender |   .0642994   .0039026    16.48   0.000     .0566503    .0719486
    Graduate |   .0586371   .0044735    13.11   0.000      .049869    .0674052
      Income |  -.0018927   .0021591    -0.88   0.381    -.0061245    .0023391
       _cons |   1.357671   .0065666   206.75   0.000       1.3448    1.370541
------------------------------------------------------------------------------

. eststo
(est7 stored)

. esttab 

---------------------------------------------------------------------------------------------------------------
> -------------
                      (1)             (2)             (3)             (4)             (5)             (6)      
>        (7)   
             SocJusValues    SocJusValues    SocJusValues    SocJusValues    SocJusValues    SocJusValues    So
> cJusValues   
---------------------------------------------------------------------------------------------------------------
> -------------
Age               -0.0641***      -0.0186***      -0.0587***      -0.0541***      -0.0580***      -0.0595***   
>    -0.0627***
                 (-33.53)         (-6.24)        (-23.96)        (-25.13)        (-27.87)        (-30.44)      
>   (-32.00)   

BIPOC               0.133***       0.0206**         0.162***        0.122***        0.127***        0.119***   
>      0.138***
                  (28.66)          (2.78)         (26.16)         (22.41)         (24.47)         (23.68)      
>    (28.71)   

FemaleGender       0.0671***       0.0670***       0.0514***       0.0495***       0.0494***       0.0574***   
>     0.0643***
                  (17.54)         (10.22)         (10.39)         (11.44)         (11.85)         (14.43)      
>    (16.48)   

Graduate           0.0729***       0.0115          0.0680***       0.0754***       0.0668***       0.0645***   
>     0.0586***
                  (16.45)          (1.60)         (11.70)         (14.94)         (13.95)         (14.60)      
>    (13.11)   

Income           -0.00487*         0.0173***      -0.0198***      -0.0131***     -0.00699**      -0.00513*     
>   -0.00189   
                  (-2.31)          (4.81)         (-7.10)         (-5.41)         (-3.03)         (-2.33)      
>    (-0.88)   

_cons               1.350***        1.569***        1.295***        1.296***        1.301***        1.311***   
>      1.358***
                 (208.83)        (131.36)        (161.07)        (182.99)        (191.41)        (197.96)      
>   (206.75)   
---------------------------------------------------------------------------------------------------------------
> -------------
N                   71673           20085           57818           70317           67914           65263      
>      68986   
---------------------------------------------------------------------------------------------------------------
> -------------
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001

. 
. log close
      name:  <unnamed>
       log:  C:\Users\sbstjp\OneDrive - Cardiff University\FinalHarvard\Appendix2.5.log
  log type:  text
 closed on:  12 May 2025, 17:35:34
---------------------------------------------------------------------------------------------------------------
